﻿using Abp.Application.Navigation;
using Abp.Localization;
using MyCompanyName.AbpZeroTemplate.Authorization;
using MyCompanyName.AbpZeroTemplate.Web.Navigation;

namespace MyCompanyName.AbpZeroTemplate.Web.Areas.Prm.Startup
{
    public class PrmNavigationProvider : NavigationProvider
    {
        public const string MenuName = "Prm";

        public override void SetNavigation(INavigationProviderContext context)
        {
            var menu = context.Manager.Menus[MenuName] = new MenuDefinition(MenuName, new FixedLocalizableString("Main Menu"));

            menu.AddItem(
                new MenuItemDefinition(PageNames.App.Prm.项目管理, L("ProjectManagement"),
                    icon: "icon-wrench", requiredPermissionName: AppPermissions.Pages_ProjectManager)
                .AddItem(new MenuItemDefinition(PageNames.App.Prm.询盘列表, L("InquiryList"), url: "app.prm.inquiry.Index",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_ProjectManager_InquiryList))
                       .AddItem(new MenuItemDefinition(PageNames.App.Prm.技术评估列表, L("InquiryTAList"), url: "app.prm.inquiry.IndexTA",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_ProjectManager_InquiryTAList))
                     .AddItem(new MenuItemDefinition(PageNames.App.Prm.项目列表, L("ProjectList"), url: "app.prm.project.Index",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_ProjectManager_ProjectList))
                .AddItem(new MenuItemDefinition(PageNames.App.Prm.进行中项目, L("ToDoProject"), url: "app.prm.project.ProjectProgress",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_ProjectManager_ToDoProject))
                    .AddItem(new MenuItemDefinition(PageNames.App.Prm.客户项目, L("CustomerProject"), url: "app.prm.project.CustomerProject",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_ProjectManager_CustomerProject))

                    .AddItem(new MenuItemDefinition(PageNames.App.Prm.阶段项目, L("PhaseProject"), url: "app.prm.project.PhaseProject",
                     icon: "icon-book", requiredPermissionName: AppPermissions.Pages_ProjectManager_PhaseProject))
               .AddItem(new MenuItemDefinition(PageNames.App.Prm.产品列表, L("ProductList"), url: "app.prm.product.Index",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_ProjectManager_ProductList))
                .AddItem(new MenuItemDefinition(PageNames.App.Prm.项目概要, L("ProjectSummary"), url: "app.prm.project.Summary",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_ProjectManager_ProjectSummary))
                .AddItem(new MenuItemDefinition(PageNames.App.Prm.概要统计, L("SummaryStatistics"), url: "app.prm.project.SummaryStatistics",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_ProjectManager_SummaryStatistics))
                .AddItem(new MenuItemDefinition(PageNames.App.Prm.概要汇总, L("SummaryView"), url: "app.prm.project.SummaryView",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_ProjectManager_SummaryGather))
                .AddItem(new MenuItemDefinition(PageNames.App.Prm.周报汇总, L("ProjectWeekly"), url: "app.prm.project.ProjectWeekly",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_ProjectManager_WeekGather))
                .AddItem(new MenuItemDefinition(PageNames.App.Prm.项目阶段, L("ProjectPhase"), url: "app.prm.project.ProjectPhase",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_ProjectManager_ProjectPhaseInfo))
                .AddItem(new MenuItemDefinition(PageNames.App.Prm.项目文档, L("ProjectDocument"), url: "app.prm.project.ProjectDocument",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_ProjectManager_ProjectDocument))
                .AddItem(new MenuItemDefinition(PageNames.App.Prm.查询中心, L("Search"), url: "app.prm.search.Index",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_ProjectManager_SearchCenter))
                );


            menu.AddItem(
              new MenuItemDefinition(PageNames.App.Prm.系统管理, L("SystemManager"),
                  icon: "icon-wrench", requiredPermissionName: AppPermissions.Pages_SystemManager)
                .AddItem(new MenuItemDefinition(PageNames.App.Prm.物质列表, L("Substance"), url: "app.system.substance.Index",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_SystemManager_Substance))
                .AddItem(new MenuItemDefinition(PageNames.App.Prm.科室管理, L("CompanyLevel"), url: "app.system.companylevel.Index",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_SystemManager_CompanyLevel))
                //.AddItem(new MenuItemDefinition(PageNames.App.Prm.事业部, L("Business"), url: "app.system.business.Index",
                //    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_SystemManager_Business))
                //.AddItem(new MenuItemDefinition(PageNames.App.Prm.研发中心, L("RdCenter"), url: "app.system.rdcenter.Index",
                //    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_SystemManager_RdCenter))
                //.AddItem(new MenuItemDefinition(PageNames.App.Prm.研究室, L("Laboratory"), url: "app.system.laboratory.Index",
                //    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_SystemManager_Laboratory))
                .AddItem(new MenuItemDefinition(PageNames.App.Prm.用户管理, L("User"), url: "app.system.user.Index",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_Administration_Users))
                .AddItem(new MenuItemDefinition(PageNames.App.Prm.区域管理, L("Area"), url: "app.system.area.Index",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_Administration_Users))
                .AddItem(new MenuItemDefinition(PageNames.App.Prm.组织架构, L("Organization"), url: "app.system.organization.Index",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_Administration_OrganizationUnits))
                .AddItem(new MenuItemDefinition(PageNames.App.Prm.角色管理, L("Role"), url: "app.system.role.Index",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_Administration_Roles))
                .AddItem(new MenuItemDefinition(PageNames.App.Prm.项目角色, L("ProjectRole"), url: "app.system.project_role.Index",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_SystemManager_ProjectRole))
                .AddItem(new MenuItemDefinition(PageNames.App.Prm.项目角色权限, L("ProjectRoleAuth"), url: "app.system.project_role_auth.Index",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_SystemManager_ProjectRoleAuth))
                .AddItem(new MenuItemDefinition(PageNames.App.Prm.项目文档权限, L("ProjectRoleDocumentAuth"), url: "app.system.project_role_auth.Document",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_SystemManager_ProjectRoleDocumentAuth))
                .AddItem(new MenuItemDefinition(PageNames.App.Prm.系统角色权限, L("SystemRoleAuth"), url: "app.system.system_role_auth.ProjectAuth",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_SystemManager_SystemRoleAuth))
                .AddItem(new MenuItemDefinition(PageNames.App.Prm.系统文档权限, L("SystemRoleDocumentAuth"), url: "app.system.system_role_auth.DocumentAuth",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_SystemManager_SystemRoleAuth))
                .AddItem(new MenuItemDefinition(PageNames.App.Prm.文档类别, L("DocumentType"), url: "app.system.document_type.Index",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_SystemManager_SystemRoleDocumentAuth))
                .AddItem(new MenuItemDefinition(PageNames.App.Prm.阶段定义, L("PhaseInfo"), url: "app.system.phase.Index",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_SystemManager_PhaseInfo))
                .AddItem(new MenuItemDefinition(PageNames.App.Prm.模板定义, L("PlanTpl"), url: "app.system.plantpl.Index",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_SystemManager_PhaseInfo))
                .AddItem(new MenuItemDefinition(PageNames.App.Prm.邮件定义, L("MailDefined"), url: "app.system.maildefined.Index",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_SystemManager_MailDefined))
                     .AddItem(new MenuItemDefinition(PageNames.App.Prm.邮件日志, L("MailLog"), url: "app.system.maildefined.Log",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_SystemManager_MailLog)).
                    AddItem(new MenuItemDefinition(PageNames.App.Prm.数据字典, L("SystemDic"), url: "app.system.dic.Index",
                    icon: "icon-book", requiredPermissionName: AppPermissions.Pages_SystemManager_SystemDic)));
        }

        private static ILocalizableString L(string name)
        {
            return new LocalizableString(name, AbpZeroTemplateConsts.LocalizationSourceName);
        }
    }
}